/*
 * Copyright © 2023-2025 puyinzhen
 * All rights reserved.
 *
 * The copyright of this work (or idea/project/document) is owned by puyinzhen. Without explicit written permission, no part of this work may be reproduced, distributed, or modified in any form for commercial purposes.
 *
 * This copyright statement applies to, but is not limited to: concept descriptions, design documents, source code, images, presentation files, and any related content.
 *
 * For permission to use this work or any part of it, please contact 1182810784@qq.com to obtain written authorization.
 */

@import '../../../style/DesignerStyle.less';

.comp-list-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #1E1E2F;
  padding: 10px;
  box-sizing: border-box;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
}

.list-search {
  padding: 0 0 16px 0;

  .component-search-input {
    width: 100%;
    height: 32px;
    background-color: #2C2C3E;
    border: 1px solid #3A3A4E;
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 12px;
    transition: all 0.2s ease;

    &:hover {
      border-color: #4FB8FF;
    }

    &:focus {
      border-color: #4FB8FF;
      box-shadow: 0 0 0 2px rgba(79, 184, 255, 0.2);
    }

    &::placeholder {
      color: #A0A0B2;
    }
  }
}

.list-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  padding-right: 5px;
  overflow-y: auto;

  &::-webkit-scrollbar {
    width: 3px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba(79, 184, 255, 0.47);
    border-radius: 3px;
  }

  &::-webkit-scrollbar-track {
    background-color: #2C2C3E;
  }

  .list-item {
    display: flex;
    flex-direction: column;
    height: 132px;
    background-color: #2C2C3E;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #1e1e2f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    cursor: grab;

    &:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
      border: 1px solid #4FB8FF;
    }

    &:active {
      cursor: grabbing;
    }

    .item-header {
      padding: 8px 12px;
      background-color: rgba(40, 40, 58, 0.8);
      border-bottom: 1px solid #3A3A4E;

      .item-name {
        font-size: 12px;
        color: #d2d2d2;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

    .item-content {
      flex: 1;
      padding: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: #1E1E2F;

      img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
      }
    }
  }
}